import getRequest from 'crm/getCrm.js'
import postRequest from 'crm/postCrm.js'
import deleteRequest from 'crm/deleteCrm.js'

//goodsindex.vue
//获取商品主页所有商品数据
export function getAllData(payload) {
  return getRequest({
      url: '/goods/allGoods',
      method: "get",
      params: payload
  })
} 
//获取单个商品详情
export function getGoodDetail(payload) {
  return getRequest({
      url: 'goods/goodDetail',
      method: "get",
      params: payload
  })
}
//收藏（商品） 
export function doCollection(payload) {
  return postRequest({
      headers: {
          'Content-Type': 'application/json;charset=UTF-8'
      },
      responseType: 'json',
      url: 'collections/collection',
      method: "post",
      data: payload
  })
}
//购买
export function doPurchase(payload) {
  return postRequest({
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    responseType: 'json',
    url: 'purchase',
    method: "post",
    data: payload
  })
}

//获取主页下半部分展示栏进入商品查询
// export function getSomeData(payload) {
//   return getRequest({
//       url: 'goods/goodQuerybyType',
//       method: "get",
//       params: payload
//   })
// }